package org.dromara.iot.enums;

import cn.hutool.core.util.IdUtil;
import lombok.Getter;

/**
 * 业务code
 */
@Getter
public enum BusinessCodeEnum {
    /**
     * 维修code
     */
    REPAIR("WX", "维修"),
    /**
     * 故障code
     */
    FAULT("GZ", "故障"),
    /**
     * 巡检code
     */
    INSPECTION("XJ", "巡检"),
    /**
     * 保养code
     */
    MAINTENANCE("BY", "保养"),
    /**
     * 报废code
     */
    SCRAP("BF", "报废"),
    /**
     * 困人code
     */
    TIRING("KR", "困人"),
    /**
     * 报警code
     */
    ALARM("BJ", "报警"),
    /**
     * 电梯事件
     */
    ELEVATOR_EVENT("EE", "电梯事件");
    final String code;
    final String desc;

    BusinessCodeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getBusinessCode() {
        return this.code + IdUtil.getSnowflakeNextId();
    }
}

